@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');

.universal-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f7f1e3;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.universal-content {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  width: 100%;  /* 改为100%以充分利用可用空间 */
  z-index: 1;
  border: 2px solid #8d6e63;
  box-sizing: border-box;
  display: flex;  /* 使用flexbox布局 */
  flex-direction: column;  /* 垂直排列子元素 */
  align-items: center;  /* 水平居中子元素 */
}

.universal-title {
  font-family: 'Ma Shan Zheng', cursive;
  color: #8d6e63;
  text-align: center;
  margin-bottom: 30px;
  font-size: 3em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.universal-upload-area {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.universal-custom-file-upload, .universal-submit-button {
  padding: 12px 24px;
  background-color: #8d6e63;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
}

.universal-custom-file-upload:hover, .universal-submit-button:hover {
  background-color: #6d4c41;
  transform: translateY(-2px);
}

input[type="file"] {
  display: none;
}

.universal-image-display {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.universal-image-container {
  position: relative;
  max-width: 45%;
}

.universal-preview-image, .universal-result-image {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.universal-image-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 15px;
  border-radius: 15px;
  font-size: 0.9em;
  margin: 3px;
}

.universal-image-label-original {
  background-color: #B0E0E6;
}

.universal-image-label-new {
  background-color: #98FB98;
}

.universal-decoration {
  position: absolute;
  width: 300px;
  height: 300px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.1;
  z-index: 0;
}

.universal-loading-container,
.universal-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%; /* 确保占满父容器 */
}

@media (max-width: 768px) {
  .universal-content {
    padding: 30px;
  }

  .universal-title {
    font-size: 2.5em;
  }

  .universal-image-container {
    max-width: 100%;
  }
}
